<?php

class Ht_Plugin_Settings extends Zend_Controller_Plugin_Abstract
{
	
	public function preDispatch(Zend_Controller_Request_Abstract $request) {
	    
		// Get the view instance
	    $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
	    if (null === $viewRenderer->view) {
	    $viewRenderer->initView();
	    }
	    $view = $viewRenderer->view;
	    
	    $s = new Model_Settings();
	    $settings = $s->getAll()->toArray();
	    
	    foreach($settings as $setting) {
		    // Assign the variables if you want to use it in layout
		    $view->assign($setting['s_name'], $setting['s_value']);
	    }
	    
    }
};
?>